<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;

//查询banner信息
Route::get('api/:version/banner/:id', 'api/:version.Banner/getBanner');

//查询主题信息
Route::get('api/:version/theme', 'api/:version.Theme/getSimpleList');
//查询单个主题列表信息
Route::get('api/:version/theme/:id', 'api/:version.Theme/getComplexOne', [], ['id' => '\d+']);

//商品路由分组
/*Route::group('api/:version/product', function (){
    //查询最新商品
    Route::get('/recent', 'api/:version.Product/getRecent');
    //获取某种分类的商品
    Route::get('/by_category', 'api/:version.Product/getAllCategory');
    //获取单个商品详情,对id参数规则进行设置
    Route::get('/:id', 'api/:version.Product/getOne', [], ['id' => '\d+']);
});*/
// 查询最新商
Route::get('api/:version/product/recent', 'api/:version.Product/getRecent');
// 获取某种分类的商品
Route::get('api/:version/product/by_category', 'api/:version.Product/getAllCategory');
// 获取单个商品详情,对id参数规则进行设置
Route::get('api/:version/product/:id', 'api/:version.Product/getOne', [], ['id' => '\d+']);
// cms 商品添加或更新
Route::post('api/:version/product', 'api/:version.Product/createOrUpdateProduct');
// cms 商品添加组图
Route::post('api/:version/product/main_img', 'api/:version.Product/addProductImgByID');
// cms 获取商品信息-分页
Route::get('api/:version/product/all', 'api/:version.Product/getProductsByPage');
// cms 删除商品 软删除
Route::delete('api/:version/product', 'api/:version.Product/deleteProductByID');

//查询所有分类
Route::get('api/:version/category/all', 'api/:version.Category/getAllCategories');

//获取token令牌
Route::post('api/:version/token/user', 'api/:version.Token/getToken');
//验证token
Route::post('api/:version/token/verify', 'api/:version.Token/verifyToken');
//token-第三方token登录
Route::post('api/:version/token/app', 'api/:version.Token/getAppToken');
// token-根据token获取role
Route::post('api/:version/token/role', 'api/:version.Token/getroleByToken');


//保存用户提交地址
Route::post('api/:version/address', 'api/:version.Address/createOrUpdateAddress');
//获取用户地址信息
Route::get('api/:version/address', 'api/:version.Address/getUserAddress');

//订单创建
Route::post('api/:version/order', 'api/:version.Order/placeOrder');
//订单历史查询
Route::get('api/:version/order/by_user', 'api/:version.Order/getSummaryByUser');
//订单详情
Route::get('api/:version/order/:id', 'api/:version.Order/getDetail', [], ['id' => '\d+']);
// cms orders
Route::get('api/:version/order/paginate', 'api/:version.Order/getSummary');
// cms 发货
Route::get('api/:version/order/delivery', 'api/:version.Order/delivery');

//支付-订单付款
Route::post('api/:version/pay/pre_order', 'api/:version.Pay/getPreOrder');
//支付-订单付款后微信回调接口
Route::post('api/:version/pay/notify', 'api/:version.Pay/receiveNotify');


//测试查询首页所有数据
Route::get('web/:version/all', 'web/:version.AllDate/getAllDate');
//测试-获取缓存
Route::get('web/:version/cache', 'web/:version.AllDate/getCache');
// 测试-面试题目
Route::get('web/:version/inter', 'web/:version.AllDate/getInterview');

















